module.exports = exports = require('lodash')

{map, flatten, zip, parseInt} = exports
tzoffset = (new Date()).getTimezoneOffset() * 60000


Date.prototype.toZoneString = ->
    new Date(@-tzoffset).toISOString()

分隔符 = /[^\d]/
Object.assign(
    module.exports
    {

        绝对时间减法 : (一年有几个周期)=>
          (a,b)=>
            a = exports.mapint(a.split(分隔符))
            b = exports.mapint(b.split(分隔符))
            return (a[0]-b[0])*一年有几个周期+(
              (a[1] or 0)-(b[1] or 0)
            )
        mapint:(collection)->
            collection.map (x)=>parseInt(x)
        flatzip:->
            flatten(zip.apply(@,arguments))
    }
)
